Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📜 add chart api documentation #3473

Merged
merged 4 commits into from
Nov 4, 2024
Merged

📜 add chart api documentation #3473

merged 4 commits into from
Nov 4, 2024

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Oct 30, 2024

This PR adds a first stab at describing how our new chart data api works. Feedback is welcome!

@owidbot
Copy link
Contributor

owidbot commented Oct 30, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-chart-api-docs

chart-diff: ✅ No charts for review.
data-diff: ✅ No differences found
Legend: +New  ~Modified  -Removed  =Identical  Details
Hint: Run this locally with etl diff REMOTE data/ --include yourdataset --verbose --snippet

Automatically updated datasets matching weekly_wildfires|excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included

Edited: 2024-11-01 14:55:34 UTC
Execution time: 3.82 seconds

Copy link
Collaborator

@Marigold Marigold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! I've added a commit to fix rendering of docs as index.md is created dynamically. You can check docs on the staging server at http://staging-site-chart-api-docs/etl/docs/api/.

Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


When using the API, you have access to the public catalog of data processed by our data team. The catalog indexes _tables_ of data, rather than datasets or individual indicators. To learn more, read about our [data model](../architecture/design/common-format.md).
We also have a larger data catalog in our ETL. This is the space where we fetch, process and prepare the data used in our charts. It contains substantially more data but it is curated to different degrees in different parts. It also offers an API although one that is less straightforward to access - for now we offer only a Python client to interact with this API. This data is structured according to our internal needs and varies a lot more in shape than the data in the public charts API - e.g. the public charts API only has time series data using time (usually the year) and entity (usually the country), whereas our ETL often has much larger datasets than contain additional dimensions like a breakdown by age group and gender.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We also have a larger data catalog in our ETL. This is the space where we fetch, process and prepare the data used in our charts. It contains substantially more data but it is curated to different degrees in different parts. It also offers an API although one that is less straightforward to access - for now we offer only a Python client to interact with this API. This data is structured according to our internal needs and varies a lot more in shape than the data in the public charts API - e.g. the public charts API only has time series data using time (usually the year) and entity (usually the country), whereas our ETL often has much larger datasets than contain additional dimensions like a breakdown by age group and gender.
We also have a larger data catalog in our ETL. This is the space where we fetch, process and prepare the data used in our charts. It contains substantially more data but it is curated to different degrees in different parts. It also offers an API although one that is less straightforward to access - for now we offer only a Python client to interact with this API. This data is structured according to our internal needs and varies a lot more in shape than the data in the public charts API - e.g. the public charts API only has time series data using time (usually the year) and entity (usually the country), whereas our ETL often has much larger datasets that contain additional dimensions like a breakdown by age group and gender.


The third column is either "Year" or "Day". If the data is annual, this is "Year" and contains only the year as an integer. If the column is "Day", the column contains a date string in the form "YYYY-MM-DD".

The final columns are the data columns, which are the time series that powers the chart. For simple line charts there is only a single data column, more complex charts can have more columns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The final columns are the data columns, which are the time series that powers the chart. For simple line charts there is only a single data column, more complex charts can have more columns.
The final columns are the data columns, which are the time series that powers the chart. For simple line charts there is only a single data column, whereas more complex charts can have more columns.

"subtitle": "The [period life expectancy](#dod:period-life-expectancy) at birth, in a given year.",
"citation": "UN WPP (2022); HMD (2023); Zijdeman et al. (2015); Riley (2005)",
"originalChartUrl": "https://ourworldindata.org/grapher/life-expectancy",
"selection": ["World", "Americas", "Europe","Africa","Asia","Oceania"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"selection": ["World", "Americas", "Europe","Africa","Asia","Oceania"]
"selection": ["World", "Americas", "Europe", "Africa", "Asia", "Oceania"]

@danyx23
Copy link
Contributor Author

danyx23 commented Nov 4, 2024

@Marigold @marcelgerber thanks a lot for your input!

@danyx23 danyx23 merged commit 1701578 into master Nov 4, 2024
6 of 7 checks passed
@danyx23 danyx23 deleted the chart-api-docs branch November 4, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants